// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space



import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.JPanel;
import org.jfree.chart.*;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYSplineRenderer;
import org.jfree.data.time.Minute;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.xy.*;
import org.jfree.ui.*;

public class XYSplineRendererDemo1a extends ApplicationFrame
{
	
		public static Date[] dates;
		public static String[] xpMin;

        public XYSplineRendererDemo1a(String s,Date[] dates, String[] xpMin)
        {
                super(s);
                this.dates = dates;
                this.xpMin = xpMin;
                JPanel jpanel = createDemoPanel();
                jpanel.setPreferredSize(new Dimension(500, 270));
                getContentPane().add(jpanel);

        }

        public static JPanel createDemoPanel()
        {
                DateAxis timeAxis = new DateAxis("time");
                timeAxis.setDateFormatOverride(new SimpleDateFormat("yyyy:MMMM:dd hh:mm:ss"));
                NumberAxis xpPerMinAxis = new NumberAxis("xp/min");
                xpPerMinAxis.setAutoRangeIncludesZero(false);
                XYSplineRenderer xysplinerenderer = new XYSplineRenderer();
                XYPlot xyplot = new XYPlot(createSampleData(dates,xpMin), timeAxis, xpPerMinAxis, xysplinerenderer);
                xyplot.setBackgroundPaint(Color.lightGray);
                xyplot.setDomainGridlinePaint(Color.white);
                xyplot.setRangeGridlinePaint(Color.white);
                xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));
                JFreeChart jfreechart = new JFreeChart("XYSplineRenderer", JFreeChart.DEFAULT_TITLE_FONT, xyplot, true);
                ChartUtilities.applyCurrentTheme(jfreechart);
                ChartPanel chartpanel = new ChartPanel(jfreechart);
                return chartpanel;
        }

        private static XYDataset createSampleData(Date[] dates, String[] xpMIN)
        {
        	 final TimeSeries s1 = new TimeSeries("Random Data 1", Minute.class);
             for(int i = 0; i < dates.length; i++){
//             	System.out.println(dates[i].toString());
//             	System.out.println(dates[i].getMonth() + " " + dates[i].getDate());
             	s1.add(new Minute(dates[i].getMinutes(),dates[i].getHours(),dates[i].getDate(),dates[i].getMonth(), dates[i].getYear()+1900), Integer.parseInt(xpMIN[i]));
             }	    
             final TimeSeriesCollection dataset = new TimeSeriesCollection();
             dataset.addSeries(s1);

             return dataset;
        	
//        	XYSeries xyseries = new XYSeries("Series 1");
//                
//                
//                xyseries.add(2D, 56.270000000000003D);
//                xyseries.add(3D, 41.32D);
//                xyseries.add(2D, 31.449999999999999D);
//                xyseries.add(3D, 30.050000000000001D);
//                xyseries.add(2D, 24.690000000000001D);
//                xyseries.add(7D, 19.780000000000001D);
//                xyseries.add(8D, 20.940000000000001D);
//                xyseries.add(9D, 16.73D);
//                xyseries.add(10D, 14.210000000000001D);
//                xyseries.add(11D, 12.44D);
//                XYSeriesCollection xyseriescollection = new XYSeriesCollection(xyseries);
//                XYSeries xyseries1 = new XYSeries("Series 2");
//                xyseries1.add(11D, 56.270000000000003D);
//                xyseries1.add(10D, 41.32D);
//                xyseries1.add(9D, 31.449999999999999D);
//                xyseries1.add(8D, 30.050000000000001D);
//                xyseries1.add(7D, 24.690000000000001D);
//                xyseries1.add(6D, 19.780000000000001D);
//                xyseries1.add(5D, 20.940000000000001D);
//                xyseries1.add(4D, 16.73D);
//                xyseries1.add(3D, 14.210000000000001D);
//                xyseries1.add(2D, 12.44D);
//                xyseriescollection.addSeries(xyseries1);
//                return xyseriescollection;
        }
}